import React, { Component } from 'react'
import '../assets/css/k-input.less'
export default class Kinput extends Component {
  handleChange = (e) => {
    this.props.onChange && this.props.onChange(e.target.value)
  }
  render() { 
    return (
      <div className={['k-input'].concat(this.props.className).join(' ')}>
        <i className={`iconfont ${this.props.icon}`}></i>
        <input
          onChange={this.handleChange}
          value={this.props.value}
          placeholder={this.props.placeholder}
          type={this.props.type}
          className="input"
        />
      </div>
    )
  }
}
